package main

import (
	"fmt"
	"go-blog/config"
	"go-blog/core"
	_ "go-blog/docs"
	"go-blog/global"
	"go-blog/router"
)

// @title Go-Blog
// @version 1.0
// @description This is a go-blog server.
// @securityDefinitions.apikey ApiKeyAuth
// @in header
// @name Authorization
func main() {
	global.Log = core.InitLogger()
	core.MysqlInit()
	core.RedisInit()
	router := router.RouterInit()
	address := fmt.Sprintf("%s:%d", config.Config.System.Host, config.Config.System.Port)
	global.Log.Infof("系统启动成功，运行在:%s", address)
	router.Run(address)
}
